<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2025/9/1
  Time: 21:02
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
  <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript">
        $(document).ready(function (){
            $("#loginBtn").click(function (){
            var account= $("#account").val();
            var password = $("#password").val();
                // 非空校验
                if (account === "" || password === "") {
                    alert("账号和密码不能为空！");
                    return;
                }

                // 发送登录请求
                $.get("login/userlogin", {
                    "account": account,
                    "password": password
                }, function (result) {
                    if (result === "登录成功") {
                        alert(result);
                        // 跳转至管理员认证页面
                        window.location.href = "adminAuth.jsp";
                    } else {
                        alert(result);
                    }
                });
            })

        })

    </script>

</head>
<body>
<table>
    <caption>供应商管理系统</caption>
    <tr>
        <td><input type="text" id="account" placeholder="请输入账号"/></td>
    </tr>
    <tr>

        <td><input type="password" id="password" placeholder="请输入密码"/></td>
    </tr>
    <tr>

        <td colspan="2"><input type="button" id="loginBtn" value="登录"/></td>
    </tr>
</table>
</body>
</html>
